Skip to content

util/managedfile: create symlink when staging files for local providers #1683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Bastian-Krause
Copy link
Member

Description
When a local TFTPProviderDriver/HTTPProviderDriver is used, the file sync can be skipped but the symlink creation in the server internal directory shouldn't.

Commit by @rvdgracht taken from #1662, leaving the maybe controversial part of creating the directory there for further discussion.

Checklist

  • PR has been tested

When a local TFTPProviderDriver/HTTPProviderDriver is used, the file sync
can be skipped but the symlink creation in the server internal directory
shouldn't.

Signed-off-by: Robin van der Gracht <[email protected]>
[bst: adjust commit message to fit common style]
@Bastian-Krause Bastian-Krause added fix pick to stable Needs a pick to the latest stable branch labels Jul 4, 2025
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 55.7%. Comparing base (f9d8ca0) to head (eaacbb5).
Report is 20 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/util/managedfile.py 33.3% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1683     +/-   ##
========================================
- Coverage    55.7%   55.7%   -0.1%     
========================================
  Files         171     172      +1     
  Lines       13408   13422     +14     
========================================
+ Hits         7477    7479      +2     
- Misses       5931    5943     +12     
Flag Coverage Δ
3.10 55.7% <33.3%> (-0.1%) ⬇️
3.11 55.7% <33.3%> (-0.1%) ⬇️
3.12 55.7% <33.3%> (-0.1%) ⬇️
3.13 55.6% <33.3%> (-0.1%) ⬇️
3.9 55.7% <33.3%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Bastian-Krause Bastian-Krause merged commit 4f5c5f5 into labgrid-project:master Jul 4, 2025
9 of 11 checks passed
@Bastian-Krause Bastian-Krause added picked to stable Already picked to the latest stable branch. and removed pick to stable Needs a pick to the latest stable branch labels Jul 7, 2025
conn.run_check(f"ln -sfn {self.rpath}{os.path.basename(self.local_path)} {symlink}")

else:
conn = sshmanager.open("localhost")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks broken, why do we need to open an SSH connection when operating on a local machine? This breaks the sandboxed tests on nixpkgs since we now open SSH connections for tests that never did this before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm okay, I thought it would be a good idea to not duplicate the symlinking logic locally in Python, but you're right, it would actually be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix picked to stable Already picked to the latest stable branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants